<script>
            <?php echo $JQUERY_CODE_1; ?>
                var url = '<?php echo $url; ?>&q=2&pageLimit=<?php echo $pageLimit; ?>';
                var lastsel; jQuery("#rowed<?php echo $flag; ?>").jqGrid({ url:url, datatype: "json",
                    <?php echo $colNames; ?>
                    colModel:[ 
                        {name:'uid',index:'uid', width:55}, 
                        {name:'nickname',index:'nickname', width:90, editable:true}, 
                        {name:'name',index:'name', width:100,editable:true}, 
                        {name:'amount',index:'amount', width:80, align:"right",editable:true}, 
                        {name:'tax',index:'tax', width:80, align:"right",editable:true}, 
                        {name:'total',index:'total', width:80,align:"right",editable:true}
                    ], 
                    rowNum:<?php echo $pageLimit; ?>, 
                    rowList:[10,20,30], 
                    pager: '#prowed<?php echo $flag; ?>', 
                    sortname: 'uid', 
                    viewrecords: true, 
                    sortorder: "asc", 
                    onSelectRow: function(id){ 
                        if(id && id!==lastsel)
                        { 
                            jQuery('#rowed<?php echo $flag; ?>').jqGrid('restoreRow',lastsel); 
                            jQuery('#rowed<?php echo $flag; ?>').jqGrid('editRow',id,true); lastsel=id; 
                        } 
                    }, 
                    editurl: "<?php echo $editUrl; ?>", caption: "Using events example" }); 
                jQuery("#rowed<?php echo $flag; ?>").jqGrid('navGrid',"#prowed<?php echo $flag; ?>",{edit:false,add:false,del:false});
                
        <?php echo $JQUERY_CODE_2; ?>
</script>
<table id="rowed<?php echo $flag; ?>"></table> <div id="prowed<?php echo $flag; ?>"></div>